#ifndef  __MyString__
#define __MyString__
#include <string.h>
#include <iostream>

class MyString{
private:
    char *start;
    char *end_of_storage;
    char *finish;



public:
    MyString();
    MyString(size_t num, char c);
    MyString(const char *str);
    MyString(const MyString &rhs);
    ~MyString();


    MyString &operator=(const MyString &rhs);
    MyString &operator=(const char *str);
    
    MyString operator+(const char *str);
    MyString operator+(const MyString &rhs);
    friend MyString operator+(const char *str, const MyString &rhs);
    
    char &operator[](const size_t index);
    const char &operator[](std::size_t index) const;

    bool operator==(const char *str)const;
    bool operator==(const MyString &rhs)const;
    friend bool operator==(const char *str, const MyString &rhs);

    friend bool operator!=(const MyString &, const MyString &);

    bool operator>(const MyString &rhs);
    bool operator>(const char *str);
    friend bool operator>(const char* str, const MyString &rhs);
    
    bool operator<(const MyString &rhs);
    bool operator<(const char *str);
    friend bool operator<(const char* str, const MyString &rhs);

    friend bool operator<=(const MyString &, const MyString &);

    friend bool operator>=(const MyString &, const MyString &);

    friend std::ostream & operator<<(std::ostream & os, const MyString & rhs);
    friend std::istream & operator>>(std::istream & is, MyString &s);

    MyString &append(const char *str);
    MyString &append(const MyString &rhs);
    char &at(const size_t index)const;
    void clear();
    bool empty() const;
    size_t size() const;
    size_t capacity()const;
    MyString &reserve(size_t num);
    void push_back(char ch); 
    const char * c_str() const;

};

#endif

